package com.smarttable.ysd.bean;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;

public class SortModel implements Parcelable{

	/**
	 * 显示的数据
	 */
	private ArrayList<AppInfo> apps;
	/**
	 * 显示数据拼音的首字母
	 */
	private String sortLetters;
	
	public static final Creator<SortModel> CREATOR = new Creator<SortModel>() {

    @Override
    public SortModel createFromParcel(Parcel source) {
      // TODO Auto-generated method stub
      return new SortModel(source);
    }

    @Override
    public SortModel[] newArray(int size) {
      // TODO Auto-generated method stub
      return new SortModel[size];
    }
	  
	};
	
	public SortModel(Parcel in){
	  apps = new ArrayList<AppInfo>();
	  in.readList(apps, ClassLoader.getSystemClassLoader());
	  sortLetters = in.readString();   
	}

	public SortModel() {
		// TODO Auto-generated constructor stub
	}

	public List<AppInfo> getApps() {
		return apps;
	}

	public void setApps(ArrayList<AppInfo> apps) {
		this.apps = apps;
	}

	public String getSortLetters() {
		return sortLetters;
	}

	public void setSortLetters(String sortLetters) {
		this.sortLetters = sortLetters;
	}

  @Override
  public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    // TODO Auto-generated method stub
 // 必须按成员变量声明的顺序读取数据，不然会出现获取数据出错  
//    dest.writeList(apps);
//    dest.writeString(sortLetters);
  }

}
